From: Chris Swindle Date: Tue, 24 Oct 2017 19:54:59 +0000 (+0100) Subject: Merge branch 'master' of github.com:rust-lang/cargo into alt-registries X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~5^2~30^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=d43bf9c5f4026f434f4f7dca56991b477f42a063;p=cargo.git Merge branch 'master' of github.com:rust-lang/cargo into alt-registries --- d43bf9c5f4026f434f4f7dca56991b477f42a063 diff --cc src/cargo/util/toml/mod.rs index c5566b9cb,32122444d..bf130b0ea --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@@ -12,9 -12,9 +12,9 @@@ use serde_ignored use toml; use url::Url; - use core::{SourceId, Profiles, PackageIdSpec, GitReference, WorkspaceConfig}; + use core::{SourceId, Profiles, PackageIdSpec, GitReference, WorkspaceConfig, WorkspaceRootConfig}; use core::{Summary, Manifest, Target, Dependency, PackageId}; -use core::{EitherManifest, VirtualManifest, Features}; +use core::{EitherManifest, VirtualManifest, Features, Feature}; use core::dependency::{Kind, Platform}; use core::manifest::{LibKind, Profile, ManifestMetadata}; use sources::CRATES_IO; @@@ -513,14 -511,9 +513,14 @@@ impl TomlManifest let mut warnings = vec![]; let mut errors = vec![]; + // Parse features first so they will be available when parsing other parts of the toml + let empty = Vec::new(); + let cargo_features = me.cargo_features.as_ref().unwrap_or(&empty); + let features = Features::new(&cargo_features, &mut warnings)?; + let project = me.project.as_ref().or_else(|| me.package.as_ref()); let project = project.ok_or_else(|| { - CargoError::from("no `package` or `project` section found.") + CargoError::from("no `package` section found.") })?; let package_name = project.name.trim(); diff --cc tests/cargotest/support/registry.rs index ff4a711cd,255fc29fc..16b41f8e1 --- a/tests/cargotest/support/registry.rs +++ b/tests/cargotest/support/registry.rs @@@ -58,13 -54,10 +58,13 @@@ pub fn init() [source.dummy-registry] registry = '{reg}' - "#, reg = registry()).as_bytes())); + + [registries.alternative] + index = '{alt}' + "#, reg = registry(), alt = alt_registry()).as_bytes())); // Init a new registry - repo(®istry_path()) + let _ = repo(®istry_path()) .file("config.json", &format!(r#" {{"dl":"{0}","api":"{0}"}} "#, dl_url())) diff --cc tests/registry.rs index 33677bdb5,6334944d7..862e1bcb2 --- a/tests/registry.rs +++ b/tests/registry.rs @@@ -75,11 -76,11 +76,11 @@@ fn deps() Package::new("baz", "0.0.1").publish(); Package::new("bar", "0.0.1").dep("baz", "*").publish(); - assert_that(p.cargo_process("build"), + assert_that(p.cargo("build"), execs().with_status(0).with_stderr(&format!("\ [UPDATING] registry `{reg}` -[DOWNLOADING] [..] v0.0.1 (registry file://[..]) -[DOWNLOADING] [..] v0.0.1 (registry file://[..]) +[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) +[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`) [COMPILING] baz v0.0.1 [COMPILING] bar v0.0.1 [COMPILING] foo v0.0.1 ({dir})